/*
 * @Author: 肖思汗 
 * @Date: 2025-06-24 23:42:00 
 * @Last Modified by: 肖思汗
 * @Last Modified time: 2025-06-27 00:36:07
 */

import Api from "src/api/Api";

// 接受邀请接口
class UserInfoApi extends Api {

    constructor() {
        super();
    }

    //微信获取用户手机号
    getPhone(code: string) {
        return this._get('/wx/getPhone', { code });
    }

    //获取当前登陆用户信息
    getCurrentUser() {
        return this._get("/wx/getCurrentUser");
    }

    //更新用户信息
    updateUserInfo(data: {
        userName: string,//昵称
        profilePicture: string,//头像
        sex: boolean,
        birth: string,//生日
        phoneNumber: string,//手机号
    }) {
        const { userName, profilePicture, sex, birth, phoneNumber } = data;
        return this._post("/wx/updateUserInfo", {
            userName,
            profilePicture,
            sex: Boolean(sex),
            birth,
            phoneNumber
        });
    }


}

const userInfoApi = new UserInfoApi();

export default userInfoApi;










